import os, sys
import pygame
from pygame.locals import *

class GuiObject:
	def __init__(self):
		# define the parent and children lists, set alive to yes and define the onclick 
		# event stack. Finally get the pygame surface
		self.parent = None
		self.children = []
		self.alive = 1
		self.x = None
		self.y = None
		self.onClick = []
		self.screen = pygame.display.get_surface()
	
	# method to add a child to this object.
	def add(self, guiObject_):
		guiObject_.parent = self
		self.children.append(guiObject_)
		
	# TODO: remove should also be a method here, needs to be implimented.
	
	
	# the next 2 function returns the x/y pos of the object taking into account the 
	# parents position in the current space.
	def getX(self):
		if self.parent:
			return self.x + self.parent.x
		else:
			return self.x
	def getY(self):
		if self.parent:
			return self.y + self.parent.y
		else:
			return self.y
			
	def clearChildren(self):
		pass
